package com.shangke.corejava.ch6.homework;
public class Rectangle {
	
	private int length;
	private int width;
	
	public Rectangle(int length, int width) {
		super();
		this.length = length;
		this.width = width;
	}

	public static void  main(String[] args) {
		Rectangle re=new Rectangle(3,4);
		re.getArea();
		re.getPer();
		re.showAll();
	}
	
	public void getArea(){//求面积
		System.out.println("矩形的面积："+length*width);
	}
	public void getPer(){//求周长
		System.out.println("矩形的周长："+2*(length+width));
	}
	public void showAll(){//
		System.out.println("长："+length);
		System.out.println("宽："+width);
	}
}
